package cn.vc.media.controller;

import cn.vc.basicmodule.entity.Result;
import cn.vc.media.entity.po.MediaFiles;
import cn.vc.media.mapper.MediaFilesMapper;
import cn.vc.media.service.MediaFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 文件查询接口
 * @author mo
 * @日期: 2024-04-11 15:21
 **/
@RestController
@RequestMapping("/mediafiles")
public class MediaFilesController {

    @Autowired
    private MediaFileService mediaFileService;

    @GetMapping
    public Result<MediaFiles> selectById(@RequestParam("id") Long id) {
        MediaFiles mediaFiles = mediaFileService.selectById(id);
        return new Result<>(1, mediaFiles);
    }
    @PostMapping("/2")
    public List<MediaFiles> selectByIds(@RequestBody List<Long> ids) {
        List<MediaFiles> mediaFilesList = mediaFileService.selectByIds(ids);
        return mediaFilesList;
    }

}

